Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(controller)!: do not attempt to infer desired revision when not specified #2980

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

krancour
Copy link
Member

@krancour krancour commented Nov 22, 2024

Fixes #2952 #2968

When determining whether an Application sync has completed successfully and again when assessing Application health as a factor in Stage health, the argocd-update step (as did legacy promotion mechanisms before it) often takes revision information into account. i.e. It often requires ApplicationSources to be observably synced to a specific revision (commit ID or chart version).

Until now, when the desired revision for a given ApplicationSource has not been explicitly specified, the argocd-update step has attempted to infer the desired revision by examining the Promotion's FreightCollection. If it found an artifact matching an ApplicationSource's repoURL field (and chart field, when applicable), that revision of the artifact was presumed to be the one that ApplicationSource should be observably synced to.

This behavior has repeatedly tripped up users for a variety of reasons, the most prominent involving a scenario wherein multiple Stages use promotion processes that update the head of a single, common branch, which is tracked by multiple Applications. When a Promotion to one such Stage pushes a new commit, deemed its "desired revision," any Application that tracks that branch (and subsequently syncs) will no longer observably be synced to its own "desired revision." A Stage's health checks count this apparent mis-sync as a health problem.

In other scenarios, this behavior has also been implicated in causing the argocd-update step to enter an infinite series of retries for what appear to be failed attempts to sync an Application.

This PR simply eliminates the behavior whereby the argocd-update step attempts to infer desired revision when none is specified. This essentially relegates the step's desiredRevision field (and the deprecated desiredCommitFromStep field) to the status of an "advanced" feature for use in scenarios not prone to the difficulties highlighted above.

This is a breaking change insofar as it changes behavior, although it will not actually break anything as it relaxes success criteria. Most users will notice nothing different. It is only users who like the more thorough health checks who may wish to now begin explicitly specifying desired revisions, which is something easily accomplished using v1.1's new EL support.

This change will be prominently mentioned in the v1.1.0 release notes.

Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Copy link

netlify bot commented Nov 22, 2024

Deploy Preview for docs-kargo-io ready!

Name Link
🔨 Latest commit 771c1b5
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-io/deploys/673ffdea3bf90800086d23ec
😎 Deploy Preview https://deploy-preview-2980.docs.kargo.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Nov 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.08%. Comparing base (40efb5c) to head (771c1b5).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2980      +/-   ##
==========================================
+ Coverage   51.04%   51.08%   +0.03%     
==========================================
  Files         280      282       +2     
  Lines       25380    25365      -15     
==========================================
+ Hits        12955    12957       +2     
+ Misses      11719    11709      -10     
+ Partials      706      699       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@krancour krancour changed the title do not attempt to infer desired revision when not specified fix(controller)!: do not attempt to infer desired revision when not specified Nov 22, 2024
Copy link
Contributor

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a codegen rerun, but otherwise looks good to me. 💯

Copy link
Member

@jessesuen jessesuen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@krancour
Copy link
Member Author

This needs a codegen rerun, but otherwise looks good to me.

Actually looks like codegen verification just timed out in CI... context deadline exceeded.

Kicked it and it ran to completion.

@krancour krancour enabled auto-merge November 22, 2024 19:07
@krancour krancour added this pull request to the merge queue Nov 22, 2024
Merged via the queue into akuity:main with commit cc293f0 Nov 22, 2024
27 of 28 checks passed
@krancour krancour deleted the krancour/desired-revision-changes branch November 22, 2024 19:20
fykaa pushed a commit to fykaa/kargo that referenced this pull request Dec 20, 2024
…pecified (akuity#2980)

Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Removing desiredCommitFromStep: commit from argocd-update causes infinite sync loop
3 participants